package com.study.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @author wuwenbo
 * @date 2020/4/1 - 15:29
 */
@Component
public class Cat implements InitializingBean , DisposableBean {
    public Cat() {
        System.out.println(" cat  ... construtor ...");
    }

    public void destroy() throws Exception {//在容器关闭的时候调用
        System.out.println(" cat ... destory ... ");
    }

    public void afterPropertiesSet() throws Exception {//在bean 创建完成并且属性都赋值以后调用
        System.out.println(" cat ... afterPropertiesSet ... ");
    }
}
